﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using NHibernate;
using NHibernate.Cfg;
using System.Configuration;

namespace TechTree.Stalk.Roots.Database.Factories
{
    /// <summary>
    /// Responsible for get mapping files from a given assembly name.
    /// </summary>
    public class NHibernateSessionFactory
    {
        private static ISessionFactory sessionFactory = null;

        private static ISessionFactory SessionFactory
        {
            get
            {
                throw new NotImplementedException();

                if (sessionFactory == null)
                {
                    NHibernate.Cfg.Configuration configuration = new NHibernate.Cfg.Configuration();
                    configuration.Configure();
                    //configuration.AddAssembly("");
                    sessionFactory = configuration.BuildSessionFactory();
                }
                return sessionFactory;
            }
        }

        public static ISession OpenSession()
        {
            return SessionFactory.OpenSession();
        }
    }
}
